package com.wjw.java.oop.encapsulation_;

/**
 * 封装：
 * ----------------------------------------------------------------
 * 1.属性私有化,使用private修饰,外部不能直接修改该class对象的属性
 * 2.要想修改该class对象的属性,提供对应的使用public修饰的getter、setter方法
 * ----------------------------------------------------------------
 */
public class Encapsulation {

    //1.
    private String name;
    private int age;
    private double salary;
    private String job;

    //2.
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return this.age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getSalary() {
        return this.salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public String getJob() {
        return this.job;
    }

    public void setJob(String job) {
        this.job = job;
    }
}
